//
//  StatusCellBottomView.swift
//  SinaWeibo
//
//  Created by yang on 15/11/14.
//  Copyright © 2015年 yang. All rights reserved.
//

import UIKit
import SnapKit
class StatusCellBottomView: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor(white: 0.98, alpha: 1)
        setupUI()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func setupUI(){
        let w: CGFloat = 0.5
        let scale = 0.4
        addSubview(retweetedBtn)
        addSubview(composeBtn)
        addSubview(likeBtn)
        retweetedBtn.snp_makeConstraints { (make) -> Void in
            make.left.top.height.equalTo(self)
        }
        let sepiewOne = sepiew()
        addSubview(sepiewOne)
        sepiewOne.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(retweetedBtn.snp_right)
            make.height.equalTo(retweetedBtn).multipliedBy(scale)
            make.centerY.equalTo(self)
            make.width.equalTo(w)
        }
        composeBtn.snp_makeConstraints { (make) -> Void in
            make.top.height.equalTo(self)
            make.left.equalTo(retweetedBtn.snp_right)
            make.width.equalTo(retweetedBtn)
        }
        let sepiewTwo = sepiew()
        addSubview(sepiewTwo)
        sepiewTwo.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(composeBtn.snp_right)
            make.height.equalTo(composeBtn).multipliedBy(scale)
            make.centerY.equalTo(self)
            make.width.equalTo(w)
        }
        likeBtn.snp_makeConstraints { (make) -> Void in
            make.top.right.height.equalTo(self)
            make.left.equalTo(composeBtn.snp_right)
            make.width.equalTo(composeBtn)
        }
        retweetedBtn.addTarget(self, action: "retweetedBtnDidClick", forControlEvents: .TouchUpInside)
    }
    @objc private func retweetedBtnDidClick(){
        let v = YQViewController()
        retweetedBtn.NavController()?.pushViewController(v, animated: true)
    
    }
    private func sepiew() -> UIView{
        let v = UIView()
        v.backgroundColor = UIColor.darkGrayColor()
        return v
    }
     private lazy var retweetedBtn:UIButton = UIButton(title: "转发", backImage: nil, color: UIColor.darkGrayColor(),image:"timeline_icon_retweet",size:10)
     private lazy var composeBtn:UIButton = UIButton(title: "评论", backImage: nil, color: UIColor.darkGrayColor(),image:"timeline_icon_comment",size:10)
     private lazy var likeBtn:UIButton = UIButton(title: "赞", backImage: nil, color: UIColor.darkGrayColor(),image:"timeline_icon_unlike",size:10)
}
